﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width">
    <title>BLAZOR DASHBOARD</title>
    <base href="/" />
    <link rel="stylesheet" type="text/css" href="css/sidebar.css" />
    <link href="css/site.css" rel="stylesheet" />

    <!--
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    -->

    <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>

</head>
<body>
    <app>Loading...</app>

    <script src="_framework/components.webassembly.js"></script>
    <script>
        var stopEvents = new Boolean("false");
        function init() {
            stopEvents = false;
        }
        window.onload = init;
        function LaunchSideBar() {

            if (stopEvents)
                return;
            ev = window.event;
            ev.stopPropagation();
            ev.preventDefault();
            //document.getElementById('sidebar-main-container').style.zIndex = "3";
            document.getElementById('nav-menu').style.marginTop = (window.scrollY - 5) + "px";
            document.getElementById('inner-nav-menu').style.height = (window.innerHeight) + "px";
            //document.getElementById('nav-menu').style.height = (window.height + 50) + "px";;

            var container = document.getElementById('sidebar-main-container');
            container.className = 'sidebar-main-container';
            container.classList.add('sidebar-nav-open');
            /*
            if (document.getElementById('top-bar').classList.contains('top-rowx')) {
                document.getElementById('top-bar').classList.remove('top-rowx');
                document.getElementById('top-bar').classList.add('top-rowx-blank');
            }
            */

            setTimeout(function () {
                document.addEventListener('click', HideSideBar);
            }, 25);
            stopEvents = true;
        }

        function HideSideBar() {
        
            ev = window.event;
            ev.stopPropagation();
            ev.preventDefault();
            //document.getElementById('sidebar-main-container').style.zIndex = "1";
            document.getElementById('sidebar-main-container').classList.remove('sidebar-nav-open');
            document.removeEventListener('click', HideSideBar);
            //DotNet.invokeMethodAsync('Blazor-Dashboard', 'RestoreTopBar').then(data => alert(data));
            /*
            document.getElementById('top-bar').classList.remove('top-rowx-blank');
            document.getElementById('top-bar').classList.add('top-rowx');
            */
            stopEvents = false;
        }

        window.onresize = function (event) {
            HideSideBar();
            /*
            if (window.innerWidth < 992) {
                if (document.getElementById('top-bar').classList.contains("top-rowx")) {
                    DotNet.invokeMethodAsync('Blazor-Dashboard', 'HideTopBar');
                    document.getElementById('top-bar').classList.remove('top-rowx');
                    document.getElementById('top-bar').classList.add('top-rowx-blank');
                }
                else {
                    //DotNet.invokeMethodAsync('Blazor-Dashboard', 'ShowTopBar');
                    //document.getElementById('top-bar').classList.remove('top-rowx-blank');
                    //document.getElementById('top-bar').classList.add('top-rowx');
                }
            }
            else {
                DotNet.invokeMethodAsync('Blazor-Dashboard', 'ShowTopBar');
                document.getElementById('top-bar').classList.remove('top-rowx-blank');
                document.getElementById('top-bar').classList.add('top-rowx');

            }
            */
        };

        window.onscroll = function () { scrollSlideInSideBar() };

        function scrollSlideInSideBar() {
            document.getElementById('nav-menu').style.marginTop = (window.scrollY - 5) + "px";

        }

        function SayHello() {
            alert("Hello");
        }
        

    </script>
</body>
</html>
